package com.bage.finance.biz.service;

import com.bage.finance.biz.dto.form.CreateVoucherForm;
import com.bage.finance.biz.dto.form.DelVoucherForm;
import com.bage.finance.biz.dto.form.ListVoucherForm;
import com.bage.finance.biz.dto.form.SaveVoucherMqForm;
import com.bage.finance.biz.dto.vo.GetVoucherVo;
import com.bage.finance.biz.dto.vo.ListVoucherVo;
import com.bage.mybatis.help.PageInfo;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;

public interface VoucherService {
    /**
     * 分页查看凭证
     * @param form
     * @return
     */
    PageInfo<ListVoucherVo> list(ListVoucherForm form);

    /**
     * 创建修改凭证
     * @param form
     * @return
     */
    Boolean save(CreateVoucherForm form);

    /**
     * 获取凭证明细
     * @param id
     * @return
     */
    GetVoucherVo get(Long id);

    /**
     * 删除凭证
     * @param form
     * @return
     */
    Boolean del(DelVoucherForm form);

    /**
     * 将凭证数据刷新到es中
     */
    void resetVoucherDocument();

    /**
     * 处理定时任务消息
     * @param form
     */
    @Async
    @EventListener
    void handleMqMsg(SaveVoucherMqForm form);
}
